@extends('layouts.admin')
@section('content')
    <style>
        .table tbody tr td{
            text-align:center;
        }
        .dataTables_filter{
            margin-left:20px;
        }
        form input{
            height:22px;
            text-align: center;
            line-height:20px;
            font-size:15px;
        }
    </style>

    <div id="content-header">
        <h1>Tables</h1>
        <div class="btn-group">
            <a class="btn btn-large tip-bottom" title="Manage Files"><i class="icon-file"></i></a>
            <a class="btn btn-large tip-bottom" title="Manage Users"><i class="icon-user"></i></a>
            <a class="btn btn-large tip-bottom" title="Manage Comments"><i class="icon-comment"></i><span class="label label-important">5</span></a>
            <a class="btn btn-large tip-bottom" title="Manage Orders"><i class="icon-shopping-cart"></i></a>
        </div>
    </div>
    <div id="breadcrumb">
        <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a>
        <a href="#" class="current">Tables</a>
    </div>
    <div class="dataTables_filter" id="DataTables_Table_0_filter">
        <form action="{{url('admin/ZanList')}}" method="get" enctype="multipart/form-data">
            <input type="radio" name="search" value="1">已点赞
            <input type="radio" name="search" value="2">未点赞
            <input type="submit"value="搜索">
        </form>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title">
								<span class="icon">
									<i class="icon-th"></i>
								</span>
                        <h5>单品列表</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>点赞ID</th>
                                <th>用户名称</th>
                                <th>单品名称</th>
                                <th>点赞状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody id="tbody">
                            @foreach($result as $sing)
                                <tr>
                                    <td>{{$sing->id}}</td>
                                    <td>{{$sing->username}}</td>
                                    <td>{{$sing->name}}</td>
                                    <td>
                                        <a href="{{url('admin/ZanEdit?id=').$sing->id.'&zanstatus='.$sing->zanstatus.'&page='}}{{isset($_GET['page'])?$_GET['page']:1}}&search={{isset($_GET['search'])?$_GET['search']:''}}"  class="btn btn-primary">{{$sing->zanstatus==1?'已点赞':'未点赞'}}</a>
                                    </td>
                                    <td>
                                        <a href="{{url('admin/ZanDel?id=').$sing->id.'&page='}}{{isset($_GET['page'])?$_GET['page']:1}}&search={{isset($_GET['search'])?$_GET['search']:''}}"  class="btn btn-primary">删除</a>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        <div class="dataTables_paginate">

                            {{$result->appends(['search' => isset($_GET['search'])?$_GET['search']:''])->links('admin.page')}}

                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row-fluid">
            <div id="footer" class="span12">
                2012 &copy; Unicorn Admin. Brought to you by <a href="https://wrapbootstrap.com/user/diablo9983">diablo9983</a>
            </div>
        </div>
    </div>
@endsection